package com.standard.controller;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.servlet.ModelAndView;


import com.alibaba.fastjson.JSON;
import com.standard.entity.Standard;
import com.standard.service.StandardService;

@Controller
public class StandardController {
	
	@Autowired
	private StandardService stds;
	
	@RequestMapping("/std.html")
	public ModelAndView showBookInfo(){
		
		ModelAndView mv = new ModelAndView();
		mv.setViewName("standard");
		System.out.println("1=============>");
		List<Standard> std = stds.findStandInfo();
		System.out.println("2=============>"+std);
		mv.addObject("std",std);
		return mv;
	}
	
	@RequestMapping("/add.html")
	public ModelAndView addStd(){
		ModelAndView mv = new ModelAndView();
		//设置跳转页面_配置的为逻辑视图名，通过视图解析器转换成真实视图路径
		mv.setViewName("add");
		return mv; 
	}
	
	

}
